<include file="__THEME__/header" />
<include file="__THEME__/editor" />
<link rel="stylesheet" href="../Public/event.css" type="text/css" media="screen" charset="utf-8" />
<script  type="text/javascript" src="__PUBLIC__/js/rcalendar.js" ></script>
<script type="text/javascript" src="../Public/js/event.js"></script>
<include file="../Public/_mainNav" />
<div class="content_holder">
<div class="content">
  <!-- 内容 begin  -->
  <div class="main no_l">
    <div class="mainbox">
      <!-- 画布 begin  -->
      <include file="../Public/_isHotList" />
      <div class="mainbox_appC">
        <div class=page_title>
          <!-- page_title begin -->
          <h2><span class="right fn f12px"><a href="javascript:history.back(-1)">返回活动首页</a></span>修改活动</h2>
        </div>
        <!-- page_title end -->
        
        <div class="groupBox">
          <div class="box1">
            <form method="post" action="{:U('//doEditEvent')}" onsubmit="return check();" enctype="multipart/form-data">
              <dl class="add_event">
                <dd>
                  <label><span class="txt_impt">*</span>活动名称：</label>
                  <div class="c2">
                    <input name="title" type="text" class="text" id="title" onfocus="this.className='text2'" onblur="this.className='text'" size="60" value="{$title}" />
                  </div>
                </dd>
                <dd>
                  <label> 活动城市：</label>
                  <div class="c2">
                    <input type="hidden" id="current" />
                    <input type="text" name="city" value="{$city}" class="text" onfocus="this.className='text2'" onblur="this.className='text'" size="30" id="selectarea" readonly />
                    <input type="button" class="btn_b" value="选择地区" onclick="selectArea()" />
                  </div>
                </dd>
                <dd>
                  <label><span class="txt_impt">*</span>活动地点：</label>
                  <div class="c2">
                    <input type="hidden" name="ts_current" id="ts_current">
                    <input type="text" class="text" onfocus="this.className='text2'" onblur="this.className='text'" size="30" name="address"  value='{$address}' />
                  </div>
                </dd>
                <dd>
                  <label><span class="txt_impt">*</span>活动时间：</label>
                  <div class="c2">
                    <input name="sTime" type="text" class="text" id="sTime" onfocus="this.className='text2';rcalendar(this,'full');" onblur="this.className='text'" size="20" value="<?php echo date( 'Y-m-d H:i:s',$sTime ); ?>" readonly/>
                    -
                    <input name="eTime" type="text" class="text" id="eTime" onfocus="this.className='text2';rcalendar(this,'full');" onblur="this.className='text'" size="20" value="<?php echo date( 'Y-m-d H:i:s',$eTime ); ?>" readonly />
                  </div>
                </dd>
                <dd>
                  <label><span class="txt_impt">*</span>截止报名：</label>
                  <div class="c2">
                    <input name="deadline" type="text" class="text" id="deadline" onfocus="this.className='text2';rcalendar(this,'full');" onblur="this.className='text'" size="20" value="<?php echo date( 'Y-m-d H:i:s',$deadline );?>" readonly />
                  </div>
                </dd>
                <dd>
                  <label> 活动经费：</label>
                  <div class="c2">
                    <select name="cost" id="cost" class="text">
                      <option value="0">免费</option>
                      <option value="1">AA制</option>
                      <option value="2">50元以下</option>
                      <option value="3">50-200元</option>
                      <option value="4">200-500元</option>
                      <option value="5">500-1000元</option>
                      <option value="6">1000元以上</option>
                    </select>
                    <script type="text/javascript" charset="utf-8">
          $( "#cost option[value='{$cost}']" ).attr( 'selected',true );
          </script>
                    资费说明：
                    <input name="costExplain" type="text" class="text" id="textfield2" onfocus="this.className='text2'" onblur="this.className='text'" size="30" value="{$costExplain}"/>
                  </div>
                </dd>
                <dd>
                  <label> 活动人数：</label>
                  <div class="c2">
                    <input name="limitCount" type="text" class="text" id="limitCount" onfocus="this.className='text2'" onblur="this.className='text'" size="5" value="<?php if( $lc == '无限制' ) {echo '0';} else{ echo $limitCount;} ?>"/>
                    <span class="cGray2"> 活动人数上限，设0表示无限制</span></div>
                </dd>
                <dd>
                  <label><span class="txt_impt">*</span>活动分类：</label>
                  <div class="c2">
                    <select name="type" id="type" class="text">
                      <option value="0">请选择活动分类</option>
                      <?php foreach($category as $k=>$cate){ ?>
                      <option value="{$k}" 
                      <php>if( $cate === $type ) {echo "selected";}</php>
                      >{$cate}
                      </option>
                      <?php } ?>
                    </select>
                  </div>
                </dd>
                <dd>
                  <label><span class="txt_impt">*</span>活动介绍：</label>
                  <div class="c2">
                    <textarea id="explain" name="explain" style="width:100%">{$explain}</textarea>
                  </div>
                </dd>
                <dd>
                  <label>联系方式：</label>
                  <div class="c2">
                    <input name="contact" type="text" class="text" id="textfield3" onfocus="this.className='text2'" onblur="this.className='text'" size="30" value="{$contact}" />
                    <br />
                    <span class="cGray2">填写联系人电话，如：张小姐，1346665XXXX </span></div>
                </dd>
                <!--
          <li>
            <div class="c1">关联群组：</div>
            <div class="c2">
              <select name="select3">
                <option>选择关联群组</option>
              </select><br />
              <span class="cGray2">必须是您自己创建的分，关联后活动话题会同步到该群组。</span></div>
          </li>
          -->
                <?php 
          $alow = "";
          $friend = "";
            if( $opts['alow'] ){
              $alow = "checked";
            }
            if( $opts['friend'] ){
              $friend = "checked";
            }
          ?>
                <dd>
                  <label>活动选项：&nbsp;&nbsp;&nbsp;</label>
                  <div class="c2">
                    <div>
                      <input type="checkbox" name="friend" id="choice1" value="1" {$friend}/>
                      只允许我关注的人参加该活动</div>
                    <div>
                      <input type="checkbox" name="alow" id="choice2" value="1" {$alow}/>
                      活动参加人员需要审批</div>
                  </div>
                </dd>
                <dd>
                  <label>活动海报：&nbsp;&nbsp;&nbsp;</label>
                  <div class="c2">
                    <input name="cover" type="file" />
                    <span class="cGray2">图片将上传您的默认相册</span><br />
                  </div>
                  <input name="old_cover" type="hidden" value='{$coverId}'>
                </dd>
                <!-- <li>
            <div class="c1">将图片上传到：</div> 
               <div class="c2">
            {:W('AlbumList',array( 'uid'=>$mid , 'form_name'=>'albumId' , 'selected'=>intval($_GET['albumId']) ) )}
            </div>
          </li> -->
                <dd>
                  <label>&nbsp;</label>
                  <div class="c2">
                    <input type="hidden" name="id" value="{$id}">
                    <input type="hidden" name="optsId" value="{$optsId}">
                    <input name="button" type="submit" class="btn_b" id="button" value="保存" />
                  </div>
                </dd>
              </dl>
            </form>
          </div>
        </div>
        <!-- end  -->
      </div>
    </div>
  </div>
</div>
</div>
<!-- 画布 end  -->
<div class="c"></div>
</div>
<!-- 内容 end -->
<include file="__THEME__/footer" />
<script>
$(document).ready(function(){
    loadEditor("explain");
});
function selectArea(){
    var typevalue = $("#current").val();
	ui.box.load(U('event/Area/area')+'&selected='+typevalue,{title:'选择城市'});
}
</script>
